using System;
using MbUnit.Framework;
using EnterpriseLibraryContrib.PostSharp4EntLib.PolicyInjection;

namespace EnterpriseLibraryContrib.PostSharp4EntLib.Test.PolicyInjection.AttributeDrivenPolicies
{
    [TestFixture]
    public class Exception
    {
        [Test]
        [ExceptionCallHandler("Eat")]
        public void TestEatException()
        {
            throw new InvalidProgramException();
        }

        [Test]
        [ExceptionCallHandler("Wrap")]
        [ExpectedException(typeof(InvalidOperationException))]
        public void TestWrapException()
        {
            throw new InvalidProgramException();
        }

        [ExceptionCallHandler("Wrap")]
        static private void WrapExceptionStatic()
        {
            throw new InvalidProgramException();
        }

        [Test]
        [ExpectedException(typeof(InvalidOperationException))]
        public void TestWrapExceptionStatic()
        {
            WrapExceptionStatic();
        }


    }
}